[ rush scan] feat: modify rush scan, support executing projects under rush and custom scanning folders.#5046
Conversation
56179b4 to
6ce11b3
Compare
| this._folders = this.defineStringListParameter({ | ||
| parameterLongName: '--folder', | ||
| parameterShortName: '-f', | ||
| argumentName: 'FOLDER', | ||
| description: | ||
| 'The folders that need to be scanned, default is src and lib.' + | ||
| 'Normally we can input all the folders under the project directory, excluding the ignored folders.' | ||
| }); | ||
| this._projects = this.defineStringListParameter({ | ||
| parameterLongName: '--only', | ||
| parameterShortName: '-o', | ||
| argumentName: 'PROJECT', | ||
| description: 'Projects that need to be checked for phantom dependencies.' | ||
| }); |
There was a problem hiding this comment.
Ideally this would support all project selection parameters. There is a way to do that for an arbitrary action.
There was a problem hiding this comment.
yeah, but i feel that this place is not very suitable for other selection capabilities, such as --to, because some projects may have their own directory structure. If it is --to, it will scan the same folder for these projects.
There was a problem hiding this comment.
In actual use, I will detect which folders under the project will be submitted, and then pass these folders to the scan command one by one for scanning, so I think using the --project flag is sufficient.
| description: | ||
| 'The folders that need to be scanned, default is src and lib.' + | ||
| 'Normally we can input all the folders under the project directory, excluding the ignored folders.' | ||
| }); |
There was a problem hiding this comment.
Don't quite understand what this [stick] is for.
6ce11b3 to
f2fe6b2
Compare
…tom scanning folders.
f2fe6b2 to
5a2532a
Compare
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
|
I think it may be useful to follow the |
|
oh, |
Summary
Details
When I was migrating a pnpm workspace project to rush.
I first set up rush.json and wrote in all the projects.
Using -o to specify the project to be scanned can avoid me going into each project directory to execute scan.
The folders to be scanned under the project are not uniform,
so I got all the folders under the project, and used ignore to read the .gitignore file to exclude,
and finally got all the folders to be scanned,
so this requires customizing the folders to be scanned.
How it was tested
build rush-lib
cd
libraries/rush-lib/src/cli/actions/test/scanRepoexecute

node <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o b --folder test-folder1execute

node <path to rush>/libraries/rush-lib/lib-commonjs/start.js scan --json -o aWhy skip ScanAction.test.ts